import axios from 'axios'
// import serveConfig from './config';


const serveAxios = axios.create({
    baseURL: '/api',
    timeout: 2000,
})

//   请求拦截
serveAxios.interceptors.request.use(
    (config) => { 
    //   config.headers['Content-Type'] = 'xxx'
    //   config.headers.PlatformType = 'h5'
    //   console.log('请求配置',config);

    return config
    }, 
(error) => {
    Promise.reject(error)
 })

//  响应拦截
serveAxios.interceptors.response.use( 
    (res)=>{
    //   console.log('相应结果',res);
    return res.data
    } ,
    (error)=>{
//   console.log(error);
    })


    export default serveAxios